package leetcode1;

public class Day15 {
    public int brokenCalc(int startValue, int target) {
        if(startValue >= target) return startValue - target;
        // /  +
        int ret=0;
        while(target > startValue) {
            ret++;
            if(target%2 == 0) target /= 2;
            else target++;
        }
        if(startValue > target) ret = ret + startValue - target;
        return ret;
    }
}
